package com.vincent.kdp.util;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

import com.vincent.baseapp.util.DialogUtil;
import com.vincent.kdp.Activity.CheckGoodsActivity;

/**
 * Created by fuxingxing on 17/2/14.
 */

public class DialogUtils {

    private volatile static DialogUtils isInstance;
    public static DialogUtils getIsInstance(){
        if(isInstance==null){
            synchronized (DialogUtil.class){
                if(isInstance==null){
                    isInstance=new DialogUtils();
                }
            }
        }
        return isInstance;
    }

    public   void createDialog(String msg, Context context){
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle("提示");
        builder.setMessage(msg);
        builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });
        AlertDialog dialog = builder.create();
        dialog.show();
    }

}
